/**
 * ReportGear(2011)
 */
package com.reportgear.report.model.cell.value;

import org.dom4j.Element;

import com.reportgear.core.data.model.SalaryDataObject;

/**
 * 薪酬档案对象<br/>
 * 中间对象，外部不需要处理
 * 
 * @version 1.0 2011-4-10
 * @author <a herf="lexloo@gmail.com">lexloo</a>
 * @since Report 1.0
 */
public class CrossDocDataObject extends AbstractCellObject {
	// X 方向字段
	private String field = "";
	// 主对象Id
	private int yId;
	// 对象值
	private String value;

	public CrossDocDataObject(String field, int yid) {
		this.field = field;
		this.yId = yid;
	}

	@Override
	public String toString() {
		return this.value;
	}

	/**
	 * @param sdo
	 */
	public void addValue(SalaryDataObject sdo) {
		this.value = sdo.getString(field);
	}

	@Override
	public void read(Element parent) {
		throw new UnsupportedOperationException();
	}

	@Override
	public void write(Element parent) {
		throw new UnsupportedOperationException();
	}

	public int getyId() {
		return yId;
	}

	/**
	 * 
	 * @return 对应字段
	 */
	public String getField() {
		return this.field;
	}

	/**
	 * 获取值
	 * 
	 * @return
	 */
	public String getValue() {
		return this.value;
	}
}
